var Storage = function Storage() {
    //如果不能new  要抛出一个错误
    throw new TypeError("Illegal constructor");
}//构造函数
catvm.safefunction(Storage); //tostring 保护
//设置原型链上显示的名字***************************************************************************
Object.defineProperties(Storage.prototype, {
    [Symbol.toStringTag]: {
        value: "Storage",
        configurable: true
    }
});
//该环境下的属性和方法***************************************************************************
Storage.prototype.length=0;

Storage.prototype.clear=function clear(){
    var temp = Object.keys(this)
    for (var i=0;temp.length>i;i++) {
        delete this[temp[i]];
    }
}; catvm.safefunction(Storage.prototype.clear);

Storage.prototype.getItem=function getItem(k){
    return this[k];
}; catvm.safefunction(Storage.prototype.getItem);

Storage.prototype.key=function key(k){
    return Object.keys(this)[k]
}; catvm.safefunction(Storage.prototype.key);

Storage.prototype.removeItem=function removeItem(k){
    delete this[k]
}; catvm.safefunction(Storage.prototype.removeItem);

Storage.prototype.setItem=function setItem(k,v){
    this[k]=v;
}; catvm.safefunction(Storage.prototype.setItem);
Storage.prototype.__defineGetter__('length', function () {
    return Object.keys(this).length
})
// 原型指向原型父亲***************************************************************************
var localStorage = {};
localStorage.__proto__ = Storage.prototype
var sessionStorage = {};
sessionStorage.__proto__ = Storage.prototype
//代理***************************************************************************
localStorage = catvm.proxy(localStorage)
sessionStorage = catvm.proxy(sessionStorage)